import Vue from 'vue'
import Router from 'vue-router'
import login from "@/components/login"
import home from "@/page/home.vue"
import index from "@/page/index.vue"
import goods from "@/page/item/goods.vue"
import kind from "@/page/item/kind.vue"
import order from "@/page/order/order.vue"
import orderDetail from "@/page/order/orderDetail.vue"
import userlist from "@/page/user/userlist"
import kindAdd from "@/page/order/add"
import other from "@/page/item/otherKind"
import goodsDetail from "@/page/item/gooddetail"
import goodsAdd from "@/page/item/goodsAdd"
import editgoods from "@/page/item/goodsEditor"
import list from "../echartslist"
Vue.use(Router)

export default new Router({
  routes: [
    {
      path:'/',
      redirect:'/index'
    },
    {
      path:'/login',
      name:'login',
      meta:{title:'登录页'},
      component:login
    },
    {
      path:'/list',
      name:'list',
      component:list
    },
    {
      path:'/index',
      name:'index',
      component:index,
      redirect:'/home',
      children:[
        {
          path:'/home',
          name:'home',
          meta:{title:'首页'},
          component:home,
        },
        {
          path:'/goodsdetail',
          name:'goodsdetail',
          meta:{title:'商品详情'},
          component:goodsDetail,
        },
        {
          path:'/goods',
          name:'goods',
          meta:{title:'商品管理'},
          component:goods,
        },
        {
          path:'/goodsadd',
          name:'goodsadd',
          meta:{title:'添加商品'},
          component:goodsAdd,
        },
        {
          path:'/editgoods',
          name:'editgoods',
          component:editgoods,
        },
        {
          path:'/other',
          name:'other',
          meta:{title:'其他品类'},
          component:other,
        },
        {
          path:'/kind',
          name:'kind',
          meta:{title:'品类管理'},
          component:kind
        },
        {
          path:'/order',
          name:'order',
          meta:{title:'订单管理'},
          component:order
        },
        {
          path:'/orderdetail',
          name:'orderdetail',
          meta:{title:'订单详情'},
          component:orderDetail
        },
        {
          path:'/kindadd',
          name:'kindadd',
          meta:{title:'品类添加'},
          component:kindAdd
        },
        {
          path:'/userlist',
          name:'userlist',
          meta:{title:'用户管理'},
          component:userlist
        }
      ]

    },
  ]
})
